#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
	string s;
	while (cin >> s) {
		int cnt = 0;
		for (int i = s.size() - 1; i >= 0; i--) {
			if (s[i] != '0')
				break;
			cnt++;
		}
		if (s[0] == '-')
			reverse(s.begin() + 1, s.end() - cnt);
		else
			reverse(s.begin(), s.end() - cnt);
		cout << s << endl;
	}
	return 0;
}
